3.190 \(\int \cot ^5(e+f x) (a+b \tan ^2(e+f x)) \, dx\)

Optimal. Leaf size=53 \[ \frac {(a-b) \cot ^2(e+f x)}{2 f}+\frac {(a-b) \log (\sin (e+f x))}{f}-\frac {a \cot ^4(e+f x)}{4 f} \]

[Out]

1/2*(a-b)*cot(f*x+e)^2/f-1/4*a*cot(f*x+e)^4/f+(a-b)*ln(sin(f*x+e))/f

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3629, 12, 3473, 3475} \[ \frac {(a-b) \cot ^2(e+f x)}{2 f}+\frac {(a-b) \log (\sin (e+f x))}{f}-\frac {a \cot ^4(e+f x)}{4 f} \]

Antiderivative was successfully verified.

[In]

Int[Cot[e + f*x]^5*(a + b*Tan[e + f*x]^2),x]

[Out]

((a - b)*Cot[e + f*x]^2)/(2*f) - (a*Cot[e + f*x]^4)/(4*f) + ((a - b)*Log[Sin[e + f*x]])/f

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3629

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[
((A*b^2 + a^2*C)*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)*(a^2 + b^2)), x] + Dist[1/(a^2 + b^2), Int[(a + b*
Tan[e + f*x])^(m + 1)*Simp[a*(A - C) - (A*b - b*C)*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, C}, x] &&
 NeQ[A*b^2 + a^2*C, 0] && LtQ[m, -1] && NeQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int \cot ^5(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx &=-\frac {a \cot ^4(e+f x)}{4 f}-\int (a-b) \cot ^3(e+f x) \, dx\\ &=-\frac {a \cot ^4(e+f x)}{4 f}-(a-b) \int \cot ^3(e+f x) \, dx\\ &=\frac {(a-b) \cot ^2(e+f x)}{2 f}-\frac {a \cot ^4(e+f x)}{4 f}-(-a+b) \int \cot (e+f x) \, dx\\ &=\frac {(a-b) \cot ^2(e+f x)}{2 f}-\frac {a \cot ^4(e+f x)}{4 f}+\frac {(a-b) \log (\sin (e+f x))}{f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.23, size = 56, normalized size = 1.06 \[ \frac {2 (a-b) \cot ^2(e+f x)+4 (a-b) (\log (\tan (e+f x))+\log (\cos (e+f x)))-a \cot ^4(e+f x)}{4 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[e + f*x]^5*(a + b*Tan[e + f*x]^2),x]

[Out]

(2*(a - b)*Cot[e + f*x]^2 - a*Cot[e + f*x]^4 + 4*(a - b)*(Log[Cos[e + f*x]] + Log[Tan[e + f*x]]))/(4*f)

________________________________________________________________________________________

fricas [A]  time = 0.41, size = 85, normalized size = 1.60 \[ \frac {2 \, {\left (a - b\right )} \log \left (\frac {\tan \left (f x + e\right )^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) \tan \left (f x + e\right )^{4} + {\left (3 \, a - 2 \, b\right )} \tan \left (f x + e\right )^{4} + 2 \, {\left (a - b\right )} \tan \left (f x + e\right )^{2} - a}{4 \, f \tan \left (f x + e\right )^{4}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^5*(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

1/4*(2*(a - b)*log(tan(f*x + e)^2/(tan(f*x + e)^2 + 1))*tan(f*x + e)^4 + (3*a - 2*b)*tan(f*x + e)^4 + 2*(a - b
)*tan(f*x + e)^2 - a)/(f*tan(f*x + e)^4)

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^5*(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)2/f*((-32*((1-cos(
f*x+exp(1)))/(1+cos(f*x+exp(1))))^2*a+384*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*a-256*(1-cos(f*x+exp(1)))/(1
+cos(f*x+exp(1)))*b)/4096+(-48*((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^2*a+48*((1-cos(f*x+exp(1)))/(1+cos(f*
x+exp(1))))^2*b+12*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*a-8*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*b-a)*1/
128/((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^2+(-a+b)/2*ln(abs((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1))+(a
-b)/4*ln(abs(1-cos(f*x+exp(1)))/abs(1+cos(f*x+exp(1)))))

________________________________________________________________________________________

maple [A]  time = 0.53, size = 69, normalized size = 1.30 \[ -\frac {b \left (\cot ^{2}\left (f x +e \right )\right )}{2 f}-\frac {b \ln \left (\sin \left (f x +e \right )\right )}{f}-\frac {a \left (\cot ^{4}\left (f x +e \right )\right )}{4 f}+\frac {a \left (\cot ^{2}\left (f x +e \right )\right )}{2 f}+\frac {a \ln \left (\sin \left (f x +e \right )\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(f*x+e)^5*(a+b*tan(f*x+e)^2),x)

[Out]

-1/2/f*b*cot(f*x+e)^2-1/f*b*ln(sin(f*x+e))-1/4*a*cot(f*x+e)^4/f+1/2*a*cot(f*x+e)^2/f+a*ln(sin(f*x+e))/f

________________________________________________________________________________________

maxima [A]  time = 0.50, size = 52, normalized size = 0.98 \[ \frac {2 \, {\left (a - b\right )} \log \left (\sin \left (f x + e\right )^{2}\right ) + \frac {2 \, {\left (2 \, a - b\right )} \sin \left (f x + e\right )^{2} - a}{\sin \left (f x + e\right )^{4}}}{4 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^5*(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

1/4*(2*(a - b)*log(sin(f*x + e)^2) + (2*(2*a - b)*sin(f*x + e)^2 - a)/sin(f*x + e)^4)/f

________________________________________________________________________________________

mupad [B]  time = 11.65, size = 74, normalized size = 1.40 \[ \frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )\right )\,\left (a-b\right )}{f}-\frac {\frac {a}{4}-{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {a}{2}-\frac {b}{2}\right )}{f\,{\mathrm {tan}\left (e+f\,x\right )}^4}-\frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )\,\left (\frac {a}{2}-\frac {b}{2}\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(e + f*x)^5*(a + b*tan(e + f*x)^2),x)

[Out]

(log(tan(e + f*x))*(a - b))/f - (a/4 - tan(e + f*x)^2*(a/2 - b/2))/(f*tan(e + f*x)^4) - (log(tan(e + f*x)^2 +
1)*(a/2 - b/2))/f

________________________________________________________________________________________

sympy [A]  time = 2.93, size = 124, normalized size = 2.34 \[ \begin {cases} \tilde {\infty } a x & \text {for}\: e = 0 \wedge f = 0 \\x \left (a + b \tan ^{2}{\relax (e )}\right ) \cot ^{5}{\relax (e )} & \text {for}\: f = 0 \\\tilde {\infty } a x & \text {for}\: e = - f x \\- \frac {a \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {a \log {\left (\tan {\left (e + f x \right )} \right )}}{f} + \frac {a}{2 f \tan ^{2}{\left (e + f x \right )}} - \frac {a}{4 f \tan ^{4}{\left (e + f x \right )}} + \frac {b \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - \frac {b \log {\left (\tan {\left (e + f x \right )} \right )}}{f} - \frac {b}{2 f \tan ^{2}{\left (e + f x \right )}} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)**5*(a+b*tan(f*x+e)**2),x)

[Out]

Piecewise((zoo*a*x, Eq(e, 0) & Eq(f, 0)), (x*(a + b*tan(e)**2)*cot(e)**5, Eq(f, 0)), (zoo*a*x, Eq(e, -f*x)), (
-a*log(tan(e + f*x)**2 + 1)/(2*f) + a*log(tan(e + f*x))/f + a/(2*f*tan(e + f*x)**2) - a/(4*f*tan(e + f*x)**4)
+ b*log(tan(e + f*x)**2 + 1)/(2*f) - b*log(tan(e + f*x))/f - b/(2*f*tan(e + f*x)**2), True))

________________________________________________________________________________________